//package com.daxue.remoteconfig.config;
//
//import com.daxue.remoteconfig.service.EnvironmentPropertiesService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.config.server.environment.EnvironmentRepository;
//
///**
// * @author daxue0929
// * @date 2022/09/22
// **/
//public class DatabasesEnvironmentRepository implements EnvironmentRepository {
//
//    private static final Logger LOG = LoggerFactory.getLogger(DatabasesEnvironmentRepository.class);
//    @Autowired
//    private EnvironmentPropertiesService environmentPropertiesService;
//
//    public Environment findOne(String application,String profile,String lable) {
//        if(StringUtils.isEmpty(application)||StringUtils.isEmpty(profile)) return null;
//        Map<String,String>properties = environmentPropertiesService.get(application, profile);
//        if(properties!=null){
//            Environment environment = new Environment(application, new String[]{profile}, lable, "1.0");
//            environment.add(new PropertySource("application.properties",properties));
//            return environment;
//        }
//        return new Environment(application,profile);
//    }
//}
